import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import { createRouterGuards } from './router-guards';
import { loginRoutes } from './constant';

const routes: Array<RouteRecordRaw> = [
  {
      path: '/',
      name: 'root',
      redirect: '/home',
      children: [
          {
              path: '/home',
              name: 'home',
              component: () => import('@/views/index.vue'),
          }
      ]
  },
]

const asyncRoutes: Array<RouteRecordRaw> = [ ...routes,  ...loginRoutes ]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: asyncRoutes,
})


// 路由守卫
// createRouterGuards(router);

export default router;